import * as qiniu from 'qiniu-js'
import request from "@/api/utils/request.js";

// 得到用户的收藏夹
export const getFavoritesByUserId = async (uId) => await request.get(`favorites/${uId}`)

export const checkVideoFavorites = async (videoId) => await request.get(`favorites/checkStatus/${videoId}`)

//用户添加新的收藏夹
export const addFavorites = async (favorites) => await request.post('favorites/createFavorites', favorites)


export const addVideoToMultipleFavorites = async (videoId, favoritesIds) => {
    return await request.post('/favorites/batchAddToFavorites', {
        videoId,
        favoritesIds
    });
};

// 用户往收藏夹中添加视频
export const addVideoToFavorites = async (videoFavorite) => await request.post('favorites/addVideoToFavorites', videoFavorite)

// 用户取消收藏的视频
export const cancelVideoFromFavorites = async (videoId, favoritesId) => {
    return await request.delete(`favorites/cancelVideoFromFavorites/${videoId}/${favoritesId}`);
};

// 用户删除收藏夹
export const delFavorites = async (cId) => await request.delete(`favorites/removeFavorites/${cId}`)



